/**
 * 
 */
package com.guoxin.prototype.improve;

/**
 * @author guoxin
 * @date 2019年8月16日
 */
public class Client {
	public static void main(String[] args) throws CloneNotSupportedException {
		Sheep sheep = new Sheep();
		sheep.setAge(10);
		sheep.setName("doli");
		sheep.setColor("white");

		Sheep friend = new Sheep();
		friend.setAge(10);
		friend.setName("tom");
		friend.setColor("black");
		sheep.setFriend(friend);

		// Sheep clone = (Sheep) sheep.clone();//使用clone方法
		Sheep clone = (Sheep) sheep.deepClone();// 使用deepClone方法
		clone.setName("doli2");
		clone.getFriend().setName("tom2");
		System.out.println(sheep);
		System.out.println(clone);

	}
}
